import time
# 输出‘执行开始',宽度为20个字符，居中，填充字符为'-'
print('{:-^20}'.format('执行开始'))
scale = 10
for i in range(scale+1):
    percent = (i/scale)*100
    a = '*' * i
    b = '.' * (scale-i)
    # print('{:^3.0f}%[{}->{}]'.format(percent,a,b))
    print('\r{:^3.0f}%[{}->{}]'.format(percent,a,b),end='')
    time.sleep(0.3)
print('\n{:-^20}'.format('执行结束'))